home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 2 / The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO / windows / tpwin31.zip / WIN31.PAS < prev    next >
Pascal/Delphi Source File  |  1992-04-06  |  44KB  |  1,425 lines

  1.  
  2. {*******************************************************}
  3. {                                                       }
  4. {       Turbo Pascal for Windows Run-time Library       }
  5. {       Windows 3.1 API Interface Unit                  }
  6. {                                                       }
  7. {       Copyright (c) 1991 Borland International        }
  8. {                                                       }
  9. {*******************************************************}
  10.  
  11. unit Win31;
  12.  
  13. interface
  14.  
  15. uses WinTypes;
  16.  
  17. const
  18.   rt_Group_Cursor     = rt_Cursor + Difference;
  19.   rt_Group_Icon       = rt_Icon + Difference;
  20.  
  21. const
  22.   err_Warning   = $8000;
  23.   err_Param     = $4000;
  24.  
  25.   err_Size_Mask   = $3000;
  26.   err_Byte        = $1000;
  27.   err_Word        = $2000;
  28.   err_DWord       = $3000;
  29.  
  30. {***** LogParamError() values }
  31.  
  32. { Generic parameter values }
  33.   err_Bad_Value      = $6001;
  34.   err_Bad_Flags      = $6002;
  35.   err_Bad_Index      = $6003;
  36.   err_Bad_DValue     = $7004;
  37.   err_Bad_DFlags     = $7005;
  38.   err_Bad_DIndex     = $7006;
  39.   err_Bad_Ptr        = $7007;
  40.   err_Bad_Func_Ptr   = $7008;
  41.   err_Bad_Selector   = $6009;
  42.   err_Bad_String_ptr = $700a;
  43.   err_Bad_Handle     = $600b;
  44.  
  45. { KERNEL parameter errors }
  46.   err_Bad_HInstance       = $6020;
  47.   err_Bad_HModule         = $6021;
  48.   err_Bad_Global_Handle   = $6022;
  49.   err_Bad_Local_Handle    = $6023;
  50.   err_Bad_Atom            = $6024;
  51.   err_Bad_Hfile           = $6025;
  52.  
  53. { USER parameter errors }
  54.   err_Bad_HWnd            = $6040;
  55.   err_Bad_HMenu           = $6041;
  56.   err_Bad_HCursor         = $6042;
  57.   err_Bad_HIcon           = $6043;
  58.   err_Bad_HDWP            = $6044;
  59.   err_Bad_CID             = $6045;
  60.   err_Bad_HDrvr           = $6046;
  61.  
  62. { GDI parameter errors }
  63.   err_Bad_COORDS    = $7060;
  64.   err_Bad_GDI_OBJECT      = $6061;
  65.   err_Bad_HDC             = $6062;
  66.   err_Bad_HPEN            = $6063;
  67.   err_Bad_HFONT           = $6064;
  68.   err_Bad_HBRUSH          = $6065;
  69.   err_Bad_HBITMAP         = $6066;
  70.   err_Bad_HRGN            = $6067;
  71.   err_Bad_HPALETTE        = $6068;
  72.   err_Bad_HMETAFILE       = $6069;
  73.  
  74. {**** LogError() values }
  75.  
  76. { KERNEL errors }
  77.   err_GAlloc              = $0001;
  78.   err_GRealloc            = $0002;
  79.   err_GLock               = $0003;
  80.   err_LAlloc              = $0004;
  81.   err_LRealloc            = $0005;
  82.   err_LLock               = $0006;
  83.   err_ALlocres            = $0007;
  84.   err_LockRes             = $0008;
  85.   err_LoadModule          = $0009;
  86.  
  87. { USER errors }
  88.   err_CreateDlg           = $0040;
  89.   err_CreateDlg2          = $0041;
  90.   err_RegisterClass       = $0042;
  91.   err_DCBusy              = $0043;
  92.   err_CreateWnd           = $0044;
  93.   err_StrucExtra          = $0045;
  94.   err_LoadStr             = $0046;
  95.   err_LoadMenu            = $0047;
  96.   err_NestedBeginPaint    = $0048;
  97.   err_BadIndex            = $0049;
  98.   err_CreateMenu          = $004a;
  99.  
  100. { GDI errors }
  101.   err_CreateDC            = $0080;
  102.   err_CreateMeta          = $0081;
  103.   err_DelObjSelected      = $0082;
  104.   err_SelBitmap           = $0083;
  105.  
  106. const
  107. { WINDEBUGINFO flags values }
  108.   wdi_Options         = $0001;
  109.   wdi_Filter          = $0002;
  110.   wdi_AllocBreak      = $0004;
  111.  
  112. { dwOptions values }
  113.   dbo_CheckHeap       = $0001;
  114.   dbo_BufferFill      = $0004;
  115.   dbo_DisableGPTrapping = $0010;
  116.   dbo_CheckFree       = $0020;
  117.  
  118.   dbo_Silent          = $8000;
  119.  
  120.   dbo_TraceBreak      = $2000;
  121.   dbo_WarningBreak    = $1000;
  122.   dbo_NoErrorBreak    = $0800;
  123.   dbo_NofatalBreak    = $0400;
  124.   dbo_INT3Break       = $0100;
  125.  
  126. { DebugOutput flags values }
  127.   dbf_Trace           = $0000;
  128.   dbf_Warning         = $4000;
  129.   dbf_Error           = $8000;
  130.   dbf_Fatal           = $c000;
  131.  
  132. { dwFilter values }
  133.   dbf_Kernel          = $1000;
  134.   dbf_Krn_MemMan      = $0001;
  135.   dbf_Krn_LoadModule  = $0002;
  136.   dbf_Krn_SegmentLoad = $0004;
  137.   dbf_User            = $0800;
  138.   dbf_GDI             = $0400;
  139.   dbf_MMSystem        = $0040;
  140.   dbf_Penwin          = $0020;
  141.   dbf_Application     = $0008;
  142.   dbf_Driver          = $0010;
  143.  
  144. const
  145.   ew_RebootSystem   = $43;
  146.  
  147. { SetErrorMode() constants }
  148.   sem_FailCriticalErrors  = $0001;
  149.   sem_NoGPFaultErrorBox   = $0002;
  150.   sem_NoOpenFileErrorBox  = $8000;
  151.  
  152. const
  153.   hInstance_Error = THandle(32);
  154.  
  155. const
  156.   of_Verify     = $0400;      { Used with OF_REOPEN }
  157.  
  158. { _llseek origin values }
  159. const
  160.   seek_set = 0;
  161.   seek_cur = 1;
  162.   seek_end = 2;
  163.  
  164. const
  165. { Errors }
  166.   wn_Success       = $0000;
  167.   wn_Not_Supported = $0001;
  168.   wn_Net_Error     = $0002;
  169.   wn_More_Data     = $0003;
  170.   wn_Bad_Pointer   = $0004;
  171.   wn_Bad_Value     = $0005;
  172.   wn_Bad_Password  = $0006;
  173.   wn_Access_Denied = $0007;
  174.   wn_Function_Busy = $0008;
  175.   wn_Windows_Error = $0009;
  176.   wn_Bad_User      = $000A;
  177.   wn_Out_Of_Memory = $000B;
  178.   wn_Cancel        = $000C;
  179.   wn_Continue      = $000D;
  180.  
  181. { Connection errors }
  182.   wn_Not_Connected     = $0030;
  183.   wn_Open_Files        = $0031;
  184.   wn_Bad_Netname       = $0032;
  185.   wn_Bad_Localname     = $0033;
  186.   wn_Already_Connected = $0034;
  187.   wn_Device_Error      = $0035;
  188.   wn_Connection_Closed = $0036;
  189.  
  190. const
  191.   cc_RoundRect        = $0100;
  192.   cp_Region           = $0002;
  193.  
  194. const
  195.   rc_GDI20_State      = $0020;
  196.   rc_SaveBitmap       = $0040;
  197.   rc_OP_DX_Output     = $4000;
  198.   rc_DevBits          = $8000;
  199.  
  200. const
  201.   Default_Charset     = 1;
  202.   Hangeul_Charset     = 129;
  203.   ChineseBig5_Charset = 136;
  204.  
  205. { OutPrecision values }
  206. const
  207.   out_TT_Precis   = 4;
  208.   out_Device_Precis = 5;
  209.   out_Raster_Precis = 6;
  210.   out_TT_Only_Precis  = 7;
  211.  
  212. { ClipPrecision values }
  213. const
  214.   clip_Mask   = $0F;
  215.   clip_LH_Angles    = $10;
  216.   clip_TT_Always    = $20;
  217.   clip_Embedded   = $80;
  218.  
  219. { tmPitchAndFamily values }
  220. const
  221.   tmpf_Fixed_Pitch    = $01;
  222.   tmpf_Vector     = $02;
  223.   tmpf_Device     = $08;
  224.   tmpf_Truetype     = $04;
  225.  
  226. { new StretchBlt() Modes (simpler names) }
  227. const
  228.   stretch_ANDScans        = 1;
  229.   stretch_ORScans         = 2;
  230.   stretch_DeleteScans     = 3;
  231.  
  232. { Metafile Functions }
  233. const
  234.   meta_StretchDIB        = $0f43;
  235.   meta_ExtFloodFill        = $0548;
  236.  
  237.   meta_ResetDC         = $014C;
  238.   meta_StartDoc        = $014D;
  239.   meta_StartPage         = $004F;
  240.   meta_EndPage         = $0050;
  241.   meta_AbortDoc        = $0052;
  242.   meta_EndDoc        = $005E;
  243.  
  244.   GetFaceName        = 513;
  245.  
  246. { wm_Size message wParam values }
  247.  
  248. const
  249.   size_Restored = 0;
  250.   size_Minimized = 1;
  251.   size_Maximized = 2;
  252.   size_MaxShow = 3;
  253.   size_MaxHide = 4;
  254.  
  255. { wm_KeyUp/Down/Char HiWord(lParam) flags }
  256.  
  257.   kf_Extended = $0100;
  258.   kf_DLGMode = $0800;
  259.   kf_MenuMode = $1000;
  260.   kf_AltDown = $2000;
  261.   kf_Repeat = $4000;
  262.   kf_Up = $8000;
  263.  
  264. { wm_Activate state values }
  265.  
  266.   wa_Inactive = 0;
  267.   wa_Active = 1;
  268.   wa_ClickActive = 2;
  269.  
  270. { Dialog window class }
  271.  
  272.   wc_Dialog = MakeIntAtom($8002);
  273.  
  274. { Get/SetWindowWord/Long offsets for use with wc_Dialog windows }
  275.  
  276.   dwl_MsgResult = 0;
  277.   dwl_DLGProc = 4;
  278.   dwl_User = 8;
  279.  
  280. { Redefined wm_NCHitTest return values }
  281.  
  282.   htMinButton = 8;
  283.   htMaxButton = 9;
  284.   htBorder = 18;
  285.  
  286. { Special HWND value for use with PostMessage() and SendMessage() }
  287. const
  288.   hWnd_Broadcast  = $FFFF;
  289.  
  290.   wh_MsgFilter = -1;
  291.  
  292.  
  293. { CallMsgFilter() and WH_SYS/MSGFILTER context codes }
  294. const
  295.   msgf_MainLoop            = 8;
  296.   msgf_User                = 4096;
  297.  
  298. {***** Power management ***************************************************}
  299. const
  300.   wm_Power      = $0048;
  301.  
  302. { wParam for WM_POWER window message and DRV_POWER driver notification }
  303.   pwr_Ok              = 1;
  304.   pwr_Fail            = -1;
  305.   pwr_SuspendRequest  = 1;
  306.   pwr_SuspendResume   = 2;
  307.   pwr_CriticalResume  = 3;
  308.  
  309. const
  310.   wm_SystemError = $0017;
  311.  
  312. const
  313.   gcw_Atom = -32;
  314.  
  315. { WM_SHOWWINDOW wParam codes }
  316. const
  317.   sw_OtherMaximized   = 2;
  318.   sw_OtherRestored    = 4;
  319.  
  320.  
  321. { Special value for CreateWindow, et al. }
  322. const
  323.   hWnd_Desktop = 0;
  324.  
  325. const
  326.   wf_Paging = $0800;
  327.   wf_WLO = $8000;
  328.  
  329.   obm_UpArrowI = 32737;
  330.   obm_DnArrowI = 32736;
  331.   obm_RgArrowI = 32735;
  332.   obm_LfArrowI = 32734;
  333.  
  334.   MouseTrails = 39;
  335.  
  336.   GetSetScreenParams = 800;
  337.  
  338.  
  339. { Network support }
  340.  
  341. function WNetAddConnection(lpszNetPath, lpszPassword,
  342.   lpszLocalName: PChar): Word;
  343. function WNetGetConnection(lpszLocalName, lpszRemoteName: PChar;
  344.   cbBufferSize: PWord): Word;
  345. function WNetCancelConnection(lpszName: PChar; tForce: Bool): Word;
  346.  
  347.  
  348. type
  349.   PNewTextMetric = ^TNewTextMetric;
  350.   TNewTextMetric = record
  351.     tmHeight: Integer;
  352.     tmAscent: Integer;
  353.     tmDescent: Integer;
  354.     tmInternalLeading: Integer;
  355.     tmExternalLeading: Integer;
  356.     tmAveCharWidth: Integer;
  357.     tmMaxCharWidth: Integer;
  358.     tmWeight: Integer;
  359.     tmItalic: Byte;
  360.     tmUnderlined: Byte;
  361.     tmStruckOut: Byte;
  362.     tmFirstChar: Byte;
  363.     tmLastChar: Byte;
  364.     tmDefaultChar: Byte;
  365.     tmBreakChar: Byte;
  366.     tmPitchAndFamily: Byte;
  367.     tmCharSet: Byte;
  368.     tmOverhang: Integer;
  369.     tmDigitizedAspectX: Integer;
  370.     tmDigitizedAspectY: Integer;
  371.     ntmFlags: Longint;            { various flags (fsSelection) }
  372.     ntmSizeEM: Word;            { size of EM }
  373.     ntmCellHeight: Word;         { height of font in notional units }
  374.     ntmAvgWidth: Word;            { average with in notional units }
  375.   end;
  376.  
  377. const
  378.   ntm_Regular = $00000040;    { possible ntmFlags bits }
  379.   ntm_Bold = $00000020;
  380.   ntm_Italic = $00000001;
  381.  
  382.   lf_FullFaceSize = 64;
  383.  
  384. type
  385.   PEnumLogFont = ^TEnumLogFont;
  386.   TEnumLogFont = record
  387.     elfLogFont: TLogFont;
  388.     elfFullName: array[0..LF_FULLFACESIZE-1] of Char;
  389.     elfStyle: array[0..LF_FACESIZE-1] of Char;
  390.   end;
  391.  
  392. const
  393.   dcx_Window = $00000001;
  394.   dcx_Cache = $00000002;
  395.   dcx_ClipChildren = $00000008;
  396.   dcx_ClipSiblings = $00000010;
  397.   dcx_ParentClip = $00000020;
  398.  
  399.   dcx_ExcludeRgn = $00000040;
  400.   dcx_IntersectRgn = $00000080;
  401.  
  402.   dcx_LockWindowUpdate = $00000400;
  403.  
  404.   dcx_UseStyle = $00010000;
  405.  
  406.   dcb_Reset = $0001;
  407.   dcb_Accumulate = $0002;
  408.   dcb_Dirty = dcb_Accumulate;
  409.   dcb_Set = dcb_Reset or dcb_Accumulate;
  410.   dcb_Enable = $0004;
  411.   dcb_Disable = $0008;
  412.  
  413.  
  414. const
  415. { GetGlyphOutline constants }
  416.   ggo_Metrics        = 0;
  417.   ggo_Bitmap         = 1;
  418.   ggo_Native         = 2;
  419.  
  420.   tt_Polygon_Type   = 24;
  421.  
  422.   tt_Prim_Line       = 1;
  423.   tt_Prim_QSPLine    = 2;
  424.  
  425.  
  426. type
  427.   PPanose = ^TPanose;
  428.   TPanose = record
  429.     bFamilyType: Byte;
  430.     bSerifStyle: Byte;
  431.     bWeight: Byte;
  432.     bProportion: Byte;
  433.     bContrast: Byte;
  434.     bStrokeVariation: Byte;
  435.     bArmStyle: Byte;
  436.     bLetterform: Byte;
  437.     bMidline: Byte;
  438.     bXHeight: Byte;
  439.   end;
  440.  
  441.   POutlineTextMetric = ^TOutlineTextMetric;
  442.   TOutlineTextMetric = record
  443.     otmSize: Word;          { I size of this structure             }
  444.     otmTextMetrics: TTextMetric;      { regular text metrics             }
  445.     otmFiller: Byte;          { want to be word aligned             }
  446.     otmPanoseNumber: TPanose;      { Panose number of font             }
  447.     otmfsSelection: Word;      { B Font selection flags (see #defines)   }
  448.     otmfsType: Word;          { B Type indicators    (see #defines)         }
  449.     otmsCharSlopeRise: Word;      { Slope angle Rise / Run   1 vertical     }
  450.     otmsCharSlopeRun: Word;      {                  0 vertical     }
  451.     otmEMSquare: Word;          { N size of EM                 }
  452.     otmAscent: Word;          { D ascent above baseline             }
  453.     otmDescent: Word;          { D descent below baseline             }
  454.     otmLineGap: Word;          { D                         }
  455.     otmCapEmHeight: Word;      { D height of upper case M             }
  456.     otmXHeight: Word;          { D height of lower case chars in font    }
  457.     otmrcFontBox: TRect;          { D Font bounding box             }
  458.     otmMacAscent: Word;          { D ascent above baseline for Mac         }
  459.     otmMacDescent: Word;       { D descent below baseline for Mac         }
  460.     otmMacLineGap: Word;       { D                         }
  461.     otmusMinimumPPEM: Word;      { D Minimum point ppem             }
  462.     otmptSubscriptSize: TPoint;      { D Size of subscript             }
  463.     otmptSubscriptOffset: TPoint;   { D Offset of subscript             }
  464.     otmptSuperscriptSize: TPoint;   { D Size of superscript             }
  465.     otmptSuperscriptOffset: TPoint; { D Offset of superscript             }
  466.     otmsStrikeoutSize: Word;      { D Strikeout size                 }
  467.     otmsStrikeoutPosition: Word;   { D Strikeout position             }
  468.     otmsUnderscoreSize: Word;      { D Underscore size                 }
  469.     otmsUnderscorePosition: Word;  { D Underscore position             }
  470.     otmpFamilyName: PChar;      { offset to family name             }
  471.     otmpFaceName: PChar;          { offset to face name             }
  472.     otmpStyleName: PChar;       { offset to Style string             }
  473.     otmpFullName: PChar;          { offset to full name             }
  474.   end;
  475.  
  476.   PFixed = ^TFixed;
  477.   TFixed = record
  478.     fract: Word;
  479.     value: Integer;
  480.   end;
  481.  
  482.   PMat2 = ^TMat2;
  483.   TMat2 = record
  484.      eM11: TFixed;
  485.      eM12: TFixed;
  486.      eM21: TFixed;
  487.      eM22: TFixed;
  488.   end;
  489.  
  490.   PGlyphMetrics = ^TGlyphMetrics;
  491.   TGlyphMetrics = record
  492.     gmBlackBoxX: Word;
  493.     gmBlackBoxY: Word;
  494.     gmptGlyphOrigin: TPoint;
  495.     gmCellIncX: Integer;
  496.     gmCellIncY: Integer;
  497.   end;
  498.  
  499.   PPointFX = ^TPointFX;
  500.   TPointFX = record
  501.     x: TFixed;
  502.     y: TFixed;
  503.   end;
  504.  
  505.   PTTPolyCurve = ^TTTPolyCurve;
  506.   TTTPolyCurve = record
  507.     wType: Word;
  508.     cpfx: Word;
  509.     apfx: array[0..0] of TPointFX;
  510.   end;
  511.  
  512.   PPolygonHeader = ^TPolygonHeader;
  513.   TPolygonHeader = record
  514.     cb: Longint;
  515.     dwType: Longint;
  516.     pfxStart: TPointFX;
  517.   end;
  518.  
  519.   PABC = ^TABC;
  520.   TABC = record
  521.     abcA: Integer;
  522.     abcB: Word;
  523.     abcC: Integer;
  524.   end;
  525.  
  526.   PRasterizer_Status = ^TRasterizer_Status;
  527.   TRasterizer_Status = record
  528.     nSize: Integer;
  529.     wFlags: Integer;
  530.     nLanguageID: Integer;
  531.   end;
  532.  
  533. { bits defined in wFlags of TRasterizer_Status }
  534. const
  535.   tt_Available = $0001;
  536.   tt_Enabled = $0002;
  537.  
  538. const
  539.   sb_LineLeft = 0;
  540.   sb_LineRight = 1;
  541.   sb_PageLeft = 2;
  542.   sb_PageRight = 3;
  543.   sb_Left = 6;
  544.   sb_Right = 7;
  545.  
  546.   esb_Enable_Both = $0000;
  547.   esb_Disable_Both = $0003;
  548.  
  549.   esb_Disable_Left = $0001;
  550.   esb_Disable_Right = $0002;
  551.  
  552.   esb_Disable_Up = $0001;
  553.   esb_Disable_Down = $0002;
  554.  
  555.   esb_Disable_LtUp = esb_Disable_Left;
  556.   esb_Disable_RtDn = esb_Disable_Right;
  557.  
  558.   vk_F17 = $80;
  559.   vk_F18 = $81;
  560.   vk_F19 = $82;
  561.   vk_F20 = $83;
  562.   vk_F21 = $84;
  563.   vk_F22 = $85;
  564.   vk_F23 = $86;
  565.   vk_F24 = $87;
  566.   vk_Scroll = $91;
  567.  
  568.   wm_CommNotify = $0044;
  569.  
  570.   wm_WindowPosChanging = $0046;
  571.   wm_WindowPosChanged = $0047;
  572.   wm_DropFiles = $0233;
  573.  
  574.   wm_PenWinFirst = $0380;
  575.   wm_PenWinLast = $038F;
  576.  
  577.   wm_Coalesce_First = $0390;
  578.   wm_Coalesce_Last = $039F;
  579.  
  580. type
  581.   { wm_WindowPosChanging/Changed record pointed to by lParam }
  582.   PWindowPos = ^TWindowPos;
  583.   TWindowPos = record
  584.     hWnd: HWnd;
  585.     hWndInsertAfter: HWnd;
  586.     x: Integer;
  587.     y: Integer;
  588.     cx: Integer;
  589.     cy: Integer;
  590.     flags: Word;
  591.   end;
  592.  
  593.   PNCCalcSize_Params = ^TNCCalcSize_Params;
  594.   TNCCalcSize_Params = record
  595.     rgrc: array[0..2] of TRect;
  596.     lppos: PWindowPos;
  597.   end;
  598.  
  599. const
  600.   { wm_NCCalcSize "window valid rect" return values }
  601.   wvr_AlignTop = $0010;
  602.   wvr_AlignLeft = $0020;
  603.   wvr_AlignBottom = $0040;
  604.   wvr_AlignRight = $0080;
  605.   wvr_HRedraw = $0100;
  606.   wvr_VRedraw = $0200;
  607.   wvr_Redraw = wvr_HRedraw or wvr_VRedraw;
  608.   wvr_ValidTRectS = $0400;
  609.  
  610.  
  611.   ma_NOActivateAndEat = 4;
  612.  
  613.   ws_ex_TopMost = $00000008;
  614.   ws_ex_AcceptFiles = $00000010;
  615.   ws_ex_Transparent = $00000020;
  616.  
  617.   cf_PenData = 10;
  618.   cf_RIFF = 11;
  619.   cf_Wave = 12;
  620.  
  621.   { Special HWnd values for SetWindowPos() hwndInsertAfter }
  622.   hwnd_Top = HWnd(0);
  623.   hwnd_Bottom = HWnd(1);
  624.   hwnd_TopMost = HWnd(-1);
  625.   hwnd_NoTopMost = HWnd(-2);
  626.  
  627.   { GetQueueStatus flags }
  628.   qs_Key = $0001;
  629.   qs_MouseMove = $0002;
  630.   qs_MouseButton = $0004;
  631.   qs_Mouse = qs_MouseMove or qs_MouseButton;
  632.   qs_PostMessage = $0008;
  633.   qs_Timer = $0010;
  634.   qs_Paint = $0020;
  635.   qs_SendMessage = $0040;
  636.   qs_AllInput = $007F;
  637.  
  638.   sm_CXDoubleClk = 36;
  639.   sm_CYDoubleClk = 37;
  640.   sm_CXIconSpacing = 38;
  641.   sm_CYIconSpacing = 39;
  642.   sm_MenuDropAlignment = 40;
  643.   sm_PenWindows = 41;
  644.   sm_DBCSEnabled = 42;
  645.  
  646.   sm_CMetrics = 43; { this overrides WINTYPES.PAS }
  647.  
  648.  
  649.   { Flags for TrackPopupMenu }
  650.   tpm_LeftButton = $0000;
  651.  
  652.   tpm_RightButton = $0002;
  653.   tpm_LeftAlign = $0000;
  654.   tpm_CenterAlign = $0004;
  655.   tpm_RightAlign = $0008;
  656.  
  657.   { RedrawWindow() flags }
  658.   rdw_Invalidate = $0001;
  659.   rdw_InternalPaint = $0002;
  660.   rdw_Erase = $0004;
  661.  
  662.   rdw_Validate = $0008;
  663.   rdw_NoInternalPaint = $0010;
  664.   rdw_NoErase = $0020;
  665.  
  666.   rdw_NoChildren = $0040;
  667.   rdw_AllChildren = $0080;
  668.  
  669.   rdw_UpdateNow = $0100;
  670.   rdw_EraseNow = $0200;
  671.   rdw_Frame = $0400;
  672.   rdw_NoFrame = $0800;
  673.  
  674.   sw_ScrollChildren = $0001;  { Scroll children within *lprcScroll. }
  675.   sw_Invalidate = $0002;  { Invalidate after scrolling }
  676.   sw_Erase = $0004;  { If sw_Invalidate, don't send wm_EraseBackground }
  677.  
  678.   color_InactiveCaptionText = 19;
  679.   color_BtnHighlight = 20;
  680.  
  681.  
  682. type
  683.   HHook = Longint;
  684.   THookProc = function (Code: Integer; wParam: Word; lParam: Longint): Longint;
  685.  
  686. const
  687.   wh_CBT = 5;
  688.   wh_SysMsgFilter = 6;
  689.   wh_Mouse = 7;
  690.   wh_Hardware = 8;
  691.   wh_Debug = 9;
  692.   wh_Shell = 10;
  693.  
  694.   hshell_WindowCreated = 1;
  695.   hshell_WindowDestroyed = 2;
  696.   hshell_ActivateShellWindow = 3;
  697.  
  698.   { CBT Hook Codes }
  699.   hcbt_MoveSize = 0;
  700.   hcbt_MinMax = 1;
  701.   hcbt_QS = 2;
  702.   hcbt_CreateWnd = 3;
  703.   hcbt_DestroyWnd = 4;
  704.   hcbt_Activate = 5;
  705.   hcbt_ClickSkipped = 6;
  706.   hcbt_KeySkipped = 7;
  707.   hcbt_SysCommAnd = 8;
  708.   hcbt_SetFocus = 9;
  709.  
  710. type
  711.   { hcbt_CreateWnd parameters pointed to by lParam }
  712.   PCBT_CreateWnd = ^TCBT_CreateWnd;
  713.   TCBT_CreateWnd = record
  714.     lpcs: PCreateStruct;
  715.     hWndInsertAfter: HWnd;
  716.   end;
  717.  
  718.   PMouseHookStruct = ^TMouseHookStruct;
  719.   TMouseHookStruct = record
  720.     pt: TPoint;
  721.     hWnd: HWnd;
  722.     wHitTestCode: Word;
  723.     dwExtraInfo: Longint;
  724.   end;
  725.  
  726.   PCBTActivateStruct = ^TCBTActivateStruct;
  727.   TCBTActivateStruct = record
  728.     fMouse: Bool;
  729.     hWndActive: HWnd;
  730.   end;
  731.  
  732.   PHardwareHookStruct = ^THardwareHookStruct;
  733.   THardwareHookStruct = record
  734.     hWnd: HWnd;
  735.     wMessage: Word;
  736.     wParam: Word;
  737.     lParam: Longint;
  738.   end;
  739.  
  740.   { Message Structure used in Journaling }
  741.   PEventMsg = TEventMsg;
  742.   TEventMsg = record
  743.     message: Word;
  744.     param: Word;
  745.     paramH: Word;
  746.     time: Longint;
  747.   end;
  748.  
  749. const
  750.   sc_ScreenSave = $F140;
  751.   sc_Hotkey = $F150;
  752.  
  753.   es_ReadOnly = $0800;
  754.   es_WantReturn = $1000;
  755.  
  756.   em_GetFirstVisible = wm_User+30;
  757.   em_SetReadOnly = wm_User+31;
  758.   em_SetWordBreakProc = wm_User+32;
  759.   em_GetWordBreakProc = wm_User+33;
  760.   em_GetPasswordChar = wm_User+34;
  761.  
  762. type
  763.  TEditWordBreakProc = function(lpch: PChar; ichCurrent: Integer; cch: Integer;
  764.    Code: Integer): Integer;
  765.  
  766. { TEditWordBreakProc code values }
  767. const
  768.   wb_Left = 0;
  769.   wb_Right = 1;
  770.   wb_IsDelimiter = 2;
  771.  
  772. const
  773.   stm_SetIcon = wm_User+0;
  774.   stm_GetIcon = wm_User+1;
  775.  
  776.   { DlgDirList, DlgDirListComboBox flags values }
  777.   ddl_ReadWrite = $0001;
  778.   ddl_ReadOnly = $0002;
  779.   ddl_Hidden = $0004;
  780.   ddl_System = $0008;
  781.   ddl_Directory = $0010;
  782.   ddl_Archive = $0020;
  783.  
  784.   ddl_PostMsgs = $2000;
  785.   ddl_Drives = $4000;
  786.   ddl_Exclusive = $8000;
  787.  
  788.  
  789.   lb_SetCaretIndex = wm_User+31;
  790.   lb_GetCaretIndex = wm_User+32;
  791.  
  792.   lb_SetItemHeight = wm_User+33;
  793.   lb_GetItemHeight = wm_User+34;
  794.   lb_FindStringExact = wm_User+35;
  795.  
  796.   lbs_DisableNoScroll = $1000;
  797.  
  798.   cbn_Closeup = 8;
  799.   cbn_SelEndOk = 9;
  800.   cbn_SelEndCancel = 10;
  801.  
  802.   cbs_DisableNoScroll = $0800;
  803.  
  804.   cb_GetDroppedControlRect = wm_User+18;
  805.   cb_SetItemHeight = wm_User+19;
  806.   cb_GetItemHeight = wm_User+20;
  807.   cb_SetExtendedUI = wm_User+21;
  808.   cb_GetExtendedUI = wm_User+22;
  809.   cb_GetDroppedState = wm_User+23;
  810.   cb_FindStringExact = wm_User+24;
  811.  
  812.   ev_CTSS = $0400;    { CTS state                    }
  813.   ev_DSRS = $0800;    { DSR state                    }
  814.   ev_RLSDS = $1000;    { RLSD state                   }
  815.   ev_RingTe = $2000;    { Ring trailing edge indicator }
  816.  
  817.   GetMaxLPT = 8;    { Max supported LPT id        }
  818.   GetMaxCOM = 9;    { Max supported COM id        }
  819.   GetBaseIRQ = 10;    { Get port base & irq for a port }
  820.  
  821.   { Comm Baud Rate indices }
  822.   cbr_110 = $FF10;
  823.   cbr_300 = $FF11;
  824.   cbr_600 = $FF12;
  825.   cbr_1200 = $FF13;
  826.   cbr_2400 = $FF14;
  827.   cbr_4800 = $FF15;
  828.   cbr_9600 = $FF16;
  829.   cbr_14400 = $FF17;
  830.   cbr_19200 = $FF18;
  831.   cbr_38400 = $FF1B;
  832.   cbr_56000 = $FF1F;
  833.   cbr_128000 = $FF23;
  834.   cbr_256000 = $FF27;
  835.  
  836.   { notifications passed in low word of lParam on wm_CommNotify messages }
  837.   cn_Receive = $01;    { bytes are available in the input queue }
  838.   cn_Transmit = $02;    { fewer than wOutTrigger bytes still     }
  839.             { remain in the output queue waiting     }
  840.             { to be transmitted.             }
  841.   cn_Event = $0004;
  842.  
  843.   drv_Load = $0001;
  844.   drv_Enable = $0002;
  845.   drv_Open = $0003;
  846.   drv_Close = $0004;
  847.   drv_Disable = $0005;
  848.   drv_Free = $0006;
  849.   drv_Configure = $0007;
  850.   drv_QueryConfigure = $0008;
  851.   drv_Install = $0009;
  852.   drv_Remove = $000A;
  853.   drv_ExitSession = $000B;
  854.   drv_ExitApplication = $000C;
  855.   drv_Power = $000F;
  856.  
  857.   drv_Reserved = $0800;
  858.   drv_User = $4000;
  859.  
  860.   { Supported return values for drv_Configure message }
  861.   drvcnf_Cancel = $0000;
  862.   drvcnf_OK = $0001;
  863.   drvcnf_Restart = $0002;
  864.  
  865.   drvea_NormalExit = $0001;
  866.   drvea_AbnormalExit = $0002;
  867.  
  868.   { GetNextDriver flags }
  869.   gnd_Forward = $00000000;
  870.   gnd_FirstInstanceOnly = $00000001;
  871.   gnd_Reverse = $00000002;
  872.  
  873. type
  874.   PDriverInfoStruct = ^TDriverInfoStruct;
  875.   TDriverInfoStruct = record
  876.     length: Word;
  877.     hDriver: THandle;
  878.     hModule: THandle;
  879.     szAliasName: array[0..128] of Char;
  880.   end;
  881.  
  882. type
  883.   PDrvConfigInfo = ^TDrvConfigInfo;
  884.   TDrvConfigInfo = record
  885.     dwDCISize: Longint;
  886.     lpszDCISectionName: PChar;
  887.     lpszDCIAliasName: PChar;
  888.   end;
  889.  
  890.  
  891. const
  892.   { MDI client style bits }
  893.   mdis_AllChildStyles = $0001;
  894.  
  895.   { wParam Flags for wm_MDITILE and wm_MDICASCADE messages. }
  896.   mditile_Vertical = $0000;
  897.   mditile_Horizontal = $0001;
  898.   mditile_SkipDisabled = $0002;
  899.  
  900.   { Parameter for SystemParametersInfo() }
  901.   spi_GetBeep = 1;
  902.   spi_SetBeep = 2;
  903.   spi_GetMouse = 3;
  904.   spi_SetMouse = 4;
  905.   spi_GetBorder = 5;
  906.   spi_SetBorder = 6;
  907.   spi_GetKeyBoardSpeed = 10;
  908.   spi_SetKeyBoardSpeed = 11;
  909.   spi_LangDriver = 12;
  910.   spi_IconHorizontalSpacing = 13;
  911.   spi_GetScreenSaveTimeout = 14;
  912.   spi_SetScreenSaveTimeout = 15;
  913.   spi_GetScreenSaveActive = 16;
  914.   spi_SetScreenSaveActive = 17;
  915.   spi_GetGridGranularity = 18;
  916.   spi_SetGridGranularity = 19;
  917.   spi_SetDeskWallpaper = 20;
  918.   spi_SetDeskPattern = 21;
  919.   spi_GetKeyBoardDelay = 22;
  920.   spi_SetKeyBoardDelay = 23;
  921.   spi_IconVerticalSpacing = 24;
  922.   spi_GetIconTitleWrap = 25;
  923.   spi_SetIconTitleWrap = 26;
  924.   spi_GetMenuDropAlignment = 27;
  925.   spi_SetMenuDropAlignment = 28;
  926.   spi_SetDoubleClkWidth = 29;
  927.   spi_SetDoubleClkHeight = 30;
  928.   spi_GetIconTitleLogfont = 31;
  929.   spi_SetDoubleClickTime = 32;
  930.   spi_SetMouseButtonSwap = 33;
  931.   spi_SetIconTitleLogfont = 34;
  932.   spi_GetFastTaskSwitch = 35;
  933.   spi_SetFastTaskSwitch = 36;
  934.  
  935.  
  936.   { Flags }
  937.   spif_UpdateIniFile = $0001;
  938.   spif_SendWinIniChange = $0002;
  939.  
  940. type
  941.   PDocInfo = ^TDocInfo;
  942.   TDocInfo = record
  943.     cbSize: Integer;
  944.     lpszDocName: PChar;
  945.     lpszOutput: PChar;
  946.   end;
  947.  
  948. type
  949.   TAbortProc = function (DC: HDC; Error: Integer): Boolean;
  950.  
  951. type
  952.   TTask = Word;
  953.  
  954. type
  955.   PWinDebugInfo = ^TWinDebugInfo;
  956.   TWinDebugInfo = record
  957.     Flags: Word;
  958.     dwOptions: Longint;
  959.     dwFilter: Longint;
  960.     achAllocModule: array[0..7] of Char;
  961.     dwAllocBreak: Longint;
  962.     dwAllocCount: Longint;
  963.   end;
  964.  
  965. const
  966.   wpf_SetMinPosition      = $0001;
  967.   wpf_RestoreToMaximized  = $0002;
  968.  
  969.   swp_FrameChanged    = $0020;
  970.   swp_NoOwnerZOrder   = $0200;
  971.   swp_NoSendChanging  = $0400;
  972.   swp_DeferErase      = $2000;
  973.  
  974.  
  975. type
  976.   PWindowPlacement = ^TWindowPlacement;
  977.   TWindowPlacement = record
  978.     length: Word;
  979.     flags: Word;
  980.     showCmd: Word;
  981.     ptMinPosition: TPoint;
  982.     ptMaxPosition: TPoint;
  983.     rcNormalPosition: TRect;
  984.   end;
  985.  
  986. type
  987.   PSize = ^TSize;
  988.   TSize = record
  989.     cX: Integer;
  990.     cY: Integer;
  991.   end;
  992.  
  993. type
  994.   TOldFontEnumProc = TFarProc;
  995.   TFontEnumProc = TFarProc;
  996.  
  997. const
  998.   TrueType_FontType  = $0004;
  999.  
  1000.  
  1001. type
  1002.   PKerningPair = ^TKerningPair;
  1003.   TKerningPair = record
  1004.     wFirst: Word;
  1005.     wSecond: Word;
  1006.     iKernAmount: Integer;
  1007.   end;
  1008.  
  1009. type
  1010.   PComStat = ^TComStat;
  1011.   TComStat = record
  1012.     status: Byte;
  1013.     cbInQue: Word;
  1014.     cbOutQue: Word;
  1015.   end;
  1016.  
  1017. const
  1018.   cstf_ctsHold    = $01;
  1019.   cstf_dsrHold    = $02;
  1020.   cstf_rlsdHold   = $04;
  1021.   cstf_xoffHold   = $08;
  1022.   cstf_xoffSent   = $10;
  1023.   cstf_Eof        = $20;
  1024.   cstf_txim       = $40;
  1025.  
  1026.  
  1027. type
  1028.   PDebugHookInfo = ^TDebugHookInfo;
  1029.   TDebugHookInfo = record
  1030.     hModuleHook: THandle;
  1031.     reserved: Longint;
  1032.     lParam: Longint;
  1033.     wParam: Word;
  1034.     code: Integer;
  1035.   end;
  1036.  
  1037. { Flags returned by GetSystemDebugState. }
  1038. const
  1039.   sds_Menu        = $0001;
  1040.   sds_SysModal    = $0002;
  1041.   sds_NoTaskQueue = $0004;
  1042.   sds_Dialog      = $0008;
  1043.   sds_TaskLocked  = $0010;
  1044.  
  1045. { Constants passed to WinHelp }
  1046. const
  1047.   help_Contents = $0003;
  1048.   help_SetContents = $0005;
  1049.   help_ContextPopup = $0008;
  1050.   help_ForceFile = $0009;
  1051.   help_Command = $0102;
  1052.   help_PartialKey = $0105;
  1053.   help_SetWinPos = $0203;
  1054.  
  1055. type
  1056.   PHelpWinInfo = ^THelpWinInfo;
  1057.   THelpWinInfo = record
  1058.     wStructSize: Integer;
  1059.     x: Integer;
  1060.     y: Integer;
  1061.     dx: Integer;
  1062.     dy: Integer;
  1063.     wMax: Integer;
  1064.     rgchMember: array[0..1] of Char;
  1065.   end;
  1066.  
  1067. { Struct pointed to by WM_GETMINMAXINFO lParam }
  1068. type
  1069.   PMinMaxInfo = ^TMinMaxInfo;
  1070.   TMinMaxInfo = record
  1071.     ptReserved: TPoint;
  1072.     ptMaxSize: TPoint;
  1073.     ptMaxPosition: TPoint;
  1074.     ptMinTrackSize: TPoint;
  1075.     ptMaxTrackSize: TPoint;
  1076.   end;
  1077.  
  1078. type
  1079.   PSegInfo = ^TSegInfo;
  1080.   TSegInfo = record
  1081.     offSegment: Word;
  1082.     cbSegment: Word;
  1083.     flags: Word;
  1084.     cbAlloc: Word;
  1085.     h: THandle;
  1086.     alignShift: Word;
  1087.     reserved: array[0..1] of Word;
  1088.   end;
  1089.  
  1090.  
  1091. const
  1092.   gfsr_SystemResources  = $0000;
  1093.   gfsr_GDIResources     = $0001;
  1094.   gfsr_UserResources    = $0002;
  1095.  
  1096.  
  1097. { function changed from Windows 3.0 to Windows 3.1 }
  1098. procedure AnsiToOem(AnsiStr, OemStr: PChar);
  1099. procedure AnsiToOemBuff(AnsiStr, OemStr: PChar; Length: Word);
  1100. function BringWindowToTop(Wnd: HWnd): Bool;
  1101. function EndDeferWindowPos(WinPosInfo: THandle): Bool;
  1102. function Escape(DC: HDC; Escape, Count: Integer; InData: PChar;
  1103.   OutData: Pointer): Integer;
  1104. function FrameRect(DC: HDC; var Rect: TRect; Brush: HBrush): Integer;
  1105. function GetMenuItemCount(Menu: HMenu): Integer;
  1106. function GetInstanceData(Instance: THandle; Data: PByte;
  1107.   Count: Integer): Integer;
  1108. procedure GlobalUnfix(Mem: THandle);
  1109. procedure OemToAnsi(OemStr, AnsiStr: PChar);
  1110. procedure OemToAnsiBuff(OemStr, AnsiStr: PChar; Length: Word);
  1111. function SetResourceHandler(Instance: THandle; ResType: PChar;
  1112.   LoadFunc: TFarProc): TFarProc;
  1113. procedure UnlockSegment(Segment: Word);
  1114. function CreateBitmap(Width, Height: Integer; Planes, BitCount: Word;
  1115.   Bits: Pointer): HBitmap;
  1116.  
  1117.  
  1118. { functions new to Windows 3.1 }
  1119. function GetTextExtentPoint(DC: HDC; Str: PChar; Count: Integer; var Size: Integer): Boolean;
  1120. function GetSystemDebugState: Longint;
  1121. function LockInput(h1: THandle; hwndInput: HWnd; fLock: Bool): Bool;
  1122. function QuerySendMessage(h1, h2, h3: THandle; lpmsg: PMsg): Bool;
  1123. function EnumFonts(DC: HDC; lpszFace: PChar; fntenmprc: TOldFontEnumProc;
  1124.   lpszData: PChar): Integer;
  1125. function GetWinDebugInfo(DebugInfo: PWinDebugInfo; Flags: Word): Bool;
  1126. function SetWinDebugInfo(DebugInfo: PWinDebugInfo): Bool;
  1127. function IsBadReadPtr(lp: Pointer; cb: Word): Bool;
  1128. function IsBadWritePtr(lp: Pointer; cb: Word): Bool;
  1129. function IsBadHugeReadPtr(lp: Pointer; cb: Longint): Bool;
  1130. function IsBadHugeWritePtr(lp: Pointer; cb: Longint): Bool;
  1131. function IsBadCodePtr(lpfn: TFarProc): Bool;
  1132. function IsBadStringPtr(lpsz: PChar; cchMax: Word): Bool;
  1133. procedure DirectedYield(Task: TTask);
  1134. function PrestoChangoSelector(SourceSel, DestSel: Word): Word;
  1135. function GetSelectorBase(Selector: Word): Longint;
  1136. function SetSelectorBase(Selector: Word; Base: Longint): Word;
  1137. function GetSelectorLimit(Selector: Word): Longint;
  1138. function SetSelectorLimit(Selector: Word; Base: Longint): Word;
  1139.  
  1140. function GetDriverInfo(hDriver: THandle; lpdis: PDriverInfoStruct): Bool;
  1141. function GetWindowPlacement(Wnd: HWnd; Placement: PWindowPlacement): Bool;
  1142. function SetWindowPlacement(Wnd: HWnd; Placement: PWindowPlacement): Bool;
  1143. function DlgDirSelectEx(Dlg: HWnd; Path: PChar; cbPath: Integer;
  1144.   ListBox: Integer): Bool;
  1145. function DlgDirSelectComboBoxEx(Dlg: HWnd; Path: PChar; cbPath: Integer;
  1146.   ComboBox: Integer): Bool;
  1147. function GetTimerResolution: Longint;
  1148. function ExitWindowsExec(Exe: PChar; Params: PChar): Bool;
  1149.  
  1150. function SpoolFile(Printer, Port, Job, F: PChar): THandle;
  1151. function QueryAbort(DC: HDC; Reserved: Integer): Bool;
  1152. function SetWindowOrgEx(DC: HDC; nX, nY: Integer; Point: PPoint): Bool;
  1153. function GetWindowOrgEx(DC: HDC; Point: PPoint): Bool;
  1154. function SetWindowExtEx(DC: HDC; nX, nY: Integer; Size: PSize): Bool;
  1155. function GetWindowExtEx(DC: HDC; Size: PSize): Bool;
  1156. function OffsetWindowOrgEx(DC: HDC; nX, nY: Integer; Point: PPoint): Bool;
  1157. function ScaleWindowExtEx(DC: HDC; Xnum, Xdenom, Ynum, Ydenom: Integer;
  1158.   Size: PSize): Bool;
  1159. function SetViewportExtEx(DC: HDC; nX, nY: Integer; Size: PSize): Bool;
  1160. function GetViewportExtEx(DC: HDC; Size: PSize): Bool;
  1161. function SetViewportOrgEx(DC: HDC; nX, nY: Integer; Point: PPoint): Bool;
  1162. function GetViewportOrgEx(DC: HDC; Point: PPoint): Bool;
  1163. function OffsetViewportOrgEx(DC: HDC; nX, nY: Integer; Point: PPoint): Bool;
  1164. function ScaleViewportExtEx(DC: HDC; Xnum, Xdenom, Ynum, Ydenom: Integer;
  1165.   Size: PSize): Bool;
  1166. function GetBrushOrgEx(DC: HDC; Point: PPoint): Bool;
  1167. function MoveToEx(DC: HDC; nX, nY: Integer; Point: PPoint): Bool;
  1168. function GetCurrentPositionEx(DC: HDC; Point: PPoint): Bool;
  1169. function GetAspectRatioFilterEx(DC: HDC; Size: PSize): Bool;
  1170. function EnumFontFamilies(DC: HDC; Family: PChar;
  1171.   EnumProc: TFontEnumProc; Data: PChar): Integer;
  1172. function GetKerningPairs(DC: HDC; i: Integer; Pair: PKerningPair): Integer;
  1173. function SetBitmapDimensionEx(BM: HBitmap; nX, nY: Integer; Size: PSize): Bool;
  1174. function GetBitmapDimensionEx(BM: HBitmap; Size: PSize): Bool;
  1175. function SetMetaFileBitsBetter(mf: THandle): THandle;
  1176. function StartDoc(DC: HDC; var di: TDocInfo): Integer;
  1177. function StartPage(DC: HDC): Integer;
  1178. function EndPage(DC: HDC): Integer;
  1179. function EndDoc(DC: HDC): Integer;
  1180. function AbortDoc(DC: HDC): Integer;
  1181. function SetAbortProc(DC: HDC; AbortProc: TAbortProc): Integer;
  1182.  
  1183. function IsTask(Task: THandle): Bool;
  1184. function GetFreeSystemResources(SysResource: Word): Word;
  1185. function GlobalAllocPtr(Flags: Word; Bytes: Longint): Pointer;
  1186. function GlobalReAllocPtr(Mem: Pointer; NewBytes: Longint; Flags: Word): Pointer;
  1187. function GlobalFreePtr(Mem: Pointer): Bool;
  1188. function GlobalLockPtr(Mem: Pointer): Bool;
  1189. procedure GlobalUnlockPtr(Mem: Pointer);
  1190. procedure LogError(Err: Word; Info: Pointer);
  1191. procedure LogParamError(Err: Word; fn: TFarProc; Param: Pointer);
  1192. function IsDBCSLeadByte(Ch: Byte): Bool;
  1193. function GetDCEx(Wnd: HWnd; Clip: HRgn; Flags: Longint): HDC;
  1194. function IsGDIObject(Obj: THandle): Bool;
  1195. function SetBoundsRect(DC: HDC; var Bounds: TRect; Flags: Word): Word;
  1196. function GetBoundsRect(DC: HDC; var Bounds: TRect; Flags: Word): Word;
  1197. function ConvertOutlineFontFile(A, B, C: PChar): Longint;
  1198. function GetFontData(A: HDC; B, C: Longint; D: PChar; E: Longint): Longint;
  1199. function GetGlyphOutline(A: HDC; B, C: Word; var D: TGlyphMetrics; E: Longint; f: PChar; var g: TMat2): Longint;
  1200. function CreateScalableFontResource(A: HDC; B, C, D: PChar): Bool;
  1201. function GetCharABCWidths(A: HDC; B, C: Word; var D: TABC): Bool;
  1202. function GetRasterizerCaps(var A: TRasterizer_Status; B: Integer): Bool;
  1203. function GetOutlineTextMetrics(A: HDC; B: Word; var C: TOutlineTextMetric): Word;
  1204. function GetMessageExtraInfo: Longint;
  1205. function GetOpenClipboardWindow: HWnd;
  1206. function GetQueueStatus(Flags: Word): Longint;
  1207. function IsMenu(Menu: HMenu): Boolean;
  1208. function RedrawWindow(Wnd: HWnd; UpdateRect: PRect; UpdateRgn: HRgn;
  1209.   Flags: Word): Bool;
  1210. function LockWindowUpdate(Wnd: HWnd): Bool;
  1211. function ScrollWindowEx(Wnd: HWnd; dx, dy: Integer; Scroll, Clip: PRect; UpdateRgn: HRgn;
  1212.   UpdateRect: PRect; Flags: Word): Integer;
  1213. function EnableScrollBar(A: HWnd; B: Integer; C: Word): Bool;
  1214. function CopyCursor(hInst: THandle; hCur: HCursor): HCursor;
  1215. function GetCursor: HCursor;
  1216. procedure GetClipCursor(var Rect: TRect);
  1217. function CopyIcon(hInst: THandle; Icon: HIcon): HIcon;
  1218. procedure MapWindowPoints(FromWnd, ToWnd: HWnd; var Point; Count: Word);
  1219. procedure MapWindowRect(FromWnd, ToWnd: HWnd; var Rect: TRect);
  1220.  
  1221. function SubtractRect(var A, B, C: TRect): Bool;
  1222.  
  1223. function SetWindowsHookEx(HookId: Integer; Hook: THookProc; Module, Task: THandle): HHook;
  1224. function UnhookWindowsHookEx(Hook: HHook): Bool;
  1225. function CallNextHookEx(Hook: HHook; Code: Integer; wParam: Word; lParam: Longint): Longint;
  1226. function EnableCommNotification(A: Integer; B: HWnd; C, D: Integer): Bool;
  1227. function OpenDriver(DriverName, SectionName: PChar; lParam2: Longint): THandle;
  1228. function CloseDriver(Driver: THandle; lParam1, lParam2: Longint): Longint;
  1229. function GetDriverModuleHandle(Driver: THandle): THandle;
  1230. function SendDriverMessage(Driver: THandle; message: Word; lParam1,
  1231.   lParam2: Longint): Longint;
  1232. function GetNextDriver(Driver: THandle; lParam: Longint): THandle;
  1233.  
  1234. function lstrcpyn(String1, String2: PChar; i: Integer): PChar;
  1235. procedure hmemcpy(p1, p2: Pointer; L: Longint);
  1236.  
  1237.  
  1238. {  Not exported by any DLL but included in WINDOWS.H
  1239.   function SetDriverMessage(Driver: THandle; Message: Word; lParam1, lParam2: LongInt): LongInt; }
  1240.  
  1241. function DefDriverProc(DriverIdentifier: Longint; DriverId: THandle; Message: Word; lParam1, lParam2: Longint): Longint;
  1242. function SystemParametersInfo(A, B: Word; C: Pointer; D: Word): Bool;
  1243.  
  1244. { Provided for compatiblity only.  Should use the Pascal RTL functions
  1245.   Ptr, Off, and Seg instead. }
  1246.  
  1247. function MakeLP(Sel, Off: Word): Pointer;
  1248. inline(
  1249.   $5A/    { POP DX }
  1250.   $58);   { POP AX }
  1251.  
  1252. function SelectorOf(lp: Pointer): THandle;
  1253. inline(
  1254.   $5A/    { POP DX }
  1255.   $58);   { POP AX }
  1256.  
  1257. function OffsetOf(lp: Pointer): Word;
  1258. inline(
  1259.   $58/    { POP AX }
  1260.   $5A);   { POP DX }
  1261.  
  1262. implementation
  1263.  
  1264. uses WinProcs;
  1265.  
  1266. function GlobalAllocPtr(Flags: Word; Bytes: Longint): Pointer;
  1267. begin
  1268.   GlobalAllocPtr := Ptr(GlobalAlloc(Flags, Bytes), 0);
  1269. end;
  1270.  
  1271. { Windows.h returns a BOOL which does not make sense to me since the
  1272.   pointer value can change if it is reallocated beyond 64k, so I
  1273.   return the new pointer or nil }
  1274. function GlobalReAllocPtr(Mem: Pointer; NewBytes: Longint; Flags: Word): Pointer;
  1275. begin
  1276.   GlobalReAllocPtr := Ptr(GlobalReAlloc(Seg(Mem), NewBytes, Flags), 0);
  1277. end;
  1278.  
  1279. function GlobalFreePtr(Mem: Pointer): Bool;
  1280. begin
  1281.   GlobalFreePtr := Bool(GlobalFree(Seg(Mem)));
  1282. end;
  1283.  
  1284. function GlobalLockPtr(Mem: Pointer): Bool;
  1285. begin
  1286.   GlobalLockPtr := Bool(GlobalLock(Seg(Mem)));
  1287. end;
  1288.  
  1289. procedure GlobalUnlockPtr(Mem: Pointer);
  1290. begin
  1291.   GlobalUnlock(Seg(Mem));
  1292. end;
  1293.  
  1294. procedure MapWindowRect(FromWnd, ToWnd: HWnd; var Rect: TRect);
  1295. begin
  1296.   MapWindowPoints(FromWnd, ToWnd, Rect, 2);
  1297. end;
  1298.  
  1299.  
  1300.  
  1301. procedure AnsiToOem;                       external 'KEYBOARD' index 5;
  1302. procedure AnsiToOemBuff;                   external 'KEYBOARD' index 134;
  1303. function BringWindowToTop;                 external 'USER'     index 45;
  1304. function CreateBitmap;                     external 'GDI'      index 48;
  1305. function EndDeferWindowPos;                external 'USER'     index 261;
  1306. function Escape;                           external 'GDI'      index 38;
  1307. function FrameRect;                        external 'USER'     index 83;
  1308. function GetMenuItemCount;                 external 'USER'     index 263;
  1309. function GetInstanceData;                  external 'KERNEL'   index 54;
  1310. procedure GlobalUnfix;                     external 'KERNEL'   index 198;
  1311. procedure OemToAnsi;                       external 'KEYBOARD' index 6;
  1312. procedure OemToAnsiBuff;                   external 'KEYBOARD' index 135;
  1313. function SetResourceHandler;               external 'KERNEL'   index 67;
  1314. procedure UnlockSegment;                   external 'KERNEL'   index 24;
  1315.  
  1316. function IsTask;                           external 'KERNEL'   index 320;
  1317. function GetFreeSystemResources;           external 'USER'     index 284;
  1318. procedure LogError;                        external 'KERNEL'   index 324;
  1319. procedure LogParamError;                   external 'KERNEL'   index 325;
  1320. function IsDBCSLeadByte;                   external 'KERNEL'   index 207;
  1321. function GetDCEx;                          external 'USER'     index 359;
  1322. function IsGDIObject;                      external 'GDI'      index 462;
  1323. function SetBoundsRect;                    external 'GDI'      index 193;
  1324. function GetBoundsRect;                    external 'GDI'      index 194;
  1325. function ConvertOutlineFontFile;           external 'GDI'      index 312;
  1326. function GetFontData;                      external 'GDI'      index 311;
  1327. function GetGlyphOutline;                  external 'GDI'      index 309;
  1328. function CreateScalableFontResource;       external 'GDI'      index 310;
  1329. function GetCharABCWidths;                 external 'GDI'      index 307;
  1330. function GetRasterizerCaps;                external 'GDI'      index 313;
  1331. function GetOutlineTextMetrics;            external 'GDI'      index 308;
  1332. function GetMessageExtraInfo;              external 'USER'     index 288;
  1333. function GetOpenClipboardWindow;           external 'USER'     index 248;
  1334. function GetQueueStatus;                   external 'USER'     index 334;
  1335. function IsMenu;                           external 'USER'     index 358;
  1336. function RedrawWindow;                     external 'USER'     index 290;
  1337. function LockWindowUpdate;                 external 'USER'     index 294;
  1338. function ScrollWindowEx;                   external 'USER'     index 319;
  1339. function EnableScrollBar;                  external 'USER'     index 482;
  1340. function CopyCursor;                       external 'USER'     index 369;
  1341. function GetCursor;                        external 'USER'     index 247;
  1342. procedure GetClipCursor;                   external 'USER'     index 309;
  1343. function CopyIcon;                         external 'USER'     index 368;
  1344. procedure MapWindowPoints;                 external 'USER'     index 258;
  1345. function SetWindowsHookEx;                 external 'USER'     index 291;
  1346. function UnhookWindowsHookEx;              external 'USER'     index 292;
  1347. function CallNextHookEx;                   external 'USER'     index 293;
  1348. function EnableCommNotification;           external 'USER'     index 245;
  1349. function OpenDriver;                       external 'USER'     index 252;
  1350. function CloseDriver;                      external 'USER'     index 253;
  1351. function GetDriverModuleHandle;            external 'USER'     index 254;
  1352. function DefDriverProc;                    external 'USER'     index 255;
  1353. function GetNextDriver;                    external 'USER'     index 257;
  1354. function SubtractRect;                     external 'USER'     index 373;
  1355. function SystemParametersInfo;             external 'USER'     index 483;
  1356.  
  1357. function WNetAddConnection;                external 'USER'     index 517;
  1358. function WNetGetConnection;                external 'USER'     index 512;
  1359. function WNetCancelConnection;             external 'USER'     index 518;
  1360.  
  1361. function GetWinDebugInfo;                  external 'KRNL386'  index 355;
  1362. function SetWinDebugInfo;                  external 'KRNL386'  index 356;
  1363. function IsBadReadPtr;                     external 'KRNL386'  index 334;
  1364. function IsBadWritePtr;                    external 'KRNL386'  index 335;
  1365. function IsBadHugeReadPtr;                 external 'KRNL386'  index 346;
  1366. function IsBadHugeWritePtr;                external 'KRNL386'  index 347;
  1367. function IsBadCodePtr;                     external 'KRNL386'  index 336;
  1368. function IsBadStringPtr;                   external 'KRNL386'  index 337;
  1369. procedure DirectedYield;                   external 'KRNL386'  index 150;
  1370. function PrestoChangoSelector;             external 'KRNL386'  index 177;
  1371. function GetSelectorBase;                  external 'KRNL386'  index 186;
  1372. function SetSelectorBase;                  external 'KRNL386'  index 187;
  1373. function GetSelectorLimit;                 external 'KRNL386'  index 188;
  1374. function SetSelectorLimit;                 external 'KRNL386'  index 189;
  1375.  
  1376. function SendDriverMessage;                external 'USER'     index 251;
  1377. function GetDriverInfo;                    external 'USER'     index 256;
  1378. function GetWindowPlacement;               external 'USER'     index 370;
  1379. function SetWindowPlacement;               external 'USER'     index 371;
  1380. function DlgDirSelectEx;                   external 'USER'     index 422;
  1381. function DlgDirSelectComboBoxEx;           external 'USER'     index 423;
  1382. function GetTimerResolution;               external 'USER'     index 14;
  1383. function ExitWindowsExec;                  external 'USER'     index 246;
  1384. function GetSystemDebugState;              external 'USER'     index 231;
  1385. function QuerySendMessage;                 external 'USER'     index 184;
  1386. function LockInput;                        external 'USER'     index 226;
  1387.  
  1388. function GetTextExtentPoint;               external 'GDI'      index 471;
  1389. function SpoolFile;                        external 'GDI'      index 254;
  1390. function QueryAbort;                       external 'GDI'      index 155;
  1391. function SetWindowOrgEx;                   external 'GDI'      index 482;
  1392. function GetWindowOrgEx;                   external 'GDI'      index 475;
  1393. function SetWindowExtEx;                   external 'GDI'      index 481;
  1394. function GetWindowExtEx;                   external 'GDI'      index 474;
  1395. function OffsetWindowOrgEx;                external 'GDI'      index 477;
  1396. function ScaleWindowExtEx;                 external 'GDI'      index 485;
  1397. function SetViewportExtEx;                 external 'GDI'      index 479;
  1398. function GetViewportExtEx;                 external 'GDI'      index 472;
  1399. function SetViewportOrgEx;                 external 'GDI'      index 480;
  1400. function GetViewportOrgEx;                 external 'GDI'      index 473;
  1401. function OffsetViewportOrgEx;              external 'GDI'      index 476;
  1402. function ScaleViewportExtEx;               external 'GDI'      index 484;
  1403. function GetBrushOrgEx;                    external 'GDI'      index 469;
  1404. function MoveToEx;                         external 'GDI'      index 483;
  1405. function GetCurrentPositionEx;             external 'GDI'      index 470;
  1406. function GetAspectRatioFilterEx;           external 'GDI'      index 486;
  1407. function EnumFontFamilies;                 external 'GDI'      index 330;
  1408. function EnumFonts;                        external 'GDI'      index 70;
  1409. function GetKerningPairs;                  external 'GDI'      index 332;
  1410. function SetBitmapDimensionEx;             external 'GDI'      index 478;
  1411. function GetBitmapDimensionEx;             external 'GDI'      index 468;
  1412. function SetMetaFileBitsBetter;            external 'GDI'      index 196;
  1413. function StartDoc;                         external 'GDI'      index 377;
  1414. function StartPage;                        external 'GDI'      index 379;
  1415. function EndPage;                          external 'GDI'      index 380;
  1416. function EndDoc;                           external 'GDI'      index 378;
  1417. function AbortDoc;                         external 'GDI'      index 382;
  1418. function SetAbortProc;                     external 'GDI'      index 381;
  1419.  
  1420. function lstrcpyn;                         external 'KRNL386'  index 353;
  1421. procedure hmemcpy;                         external 'KRNL386'  index 348;
  1422.  
  1423.  
  1424. end.
  1425.